package com.test.designPattern.ch3;

public class SingleObject {

    private static SingleObject singleObject;
    private SingleObject(){}



    public static synchronized SingleObject getInstance(){
        if (singleObject==null){
            singleObject = new SingleObject();
        }
        return singleObject;
    }

    public void hello(){
        System.out.println("this is singleton ... ");
    }


}
